#include "Common.h"
#include "FontBase.h"
#include <stdarg.h>
#include "GL/glew.h"

using namespace RayFrame;

FontBase::FontBase():
  NormalFontBase(0), TextureFontBase(0), TextureFontFont(0)
{
  m_fontType = NoFont;
}

FontBase::~FontBase()
{
#if defined WIN32
  m_hGDIFont = NULL;
#endif
}

void FontBase::PrintText(int x, int y, STRING str)
{
  PrintText(x, y, str.c_str());
}

void FontBase::PrintText(int x, int y, const char *string, ...)
{
  char  text[1024];                    // Holds Our String
  va_list  pArguments;                 // Pointer To List Of Arguments

  if (string == NULL)                  // If There's No Text
    return;                            // Do Nothing

  va_start(pArguments, string);        // Parses The String For Variables
  vsprintf(text, string, pArguments);  // And Converts Symbols To Actual Numbers
  va_end(pArguments);                  // Results Are Stored In Text

  switch(m_fontType)
  {
  case NoFont:
    return;
  case SystemFont:
    PrintSystemFontText(x, y, text);
    break;
  case TextureFont:
    //PrintTextureText(x, y, text);
    break;
#ifdef WIN32
  case GDIFont:
    break;
#endif  
  default:
    return;
  }
}
